import request from '@/utils/request'

const aiModelsApi = {
    /**
     * 模型通道
     */
    channel(): Promise<any> {
        return request.get({
            url: '/setting/ai/models/channel'
        })
    },
    /**
     * 模型列表
     */
    lists(params: {
        scene: string;
    }): Promise<any> {
        return request.get({
            url: '/setting/ai/models/lists',
            params
        })
    },
    /**
     * 模型详情
     */
    detail(id: number): Promise<any> {
        return request.get({
            url: '/setting/ai/models/detail',
            params: { id }
        })
    },
    /**
     * 模型新增
     */
    add(params: {
        scene: string;
        channel: string;
        logo: string;
        name: string;
        intro: string;
        config: any;
        models: any[];
        is_disable: number;
    }): Promise<any> {
        return request.post({
            url: '/setting/ai/models/add',
            params
        })
    },
    /**
     * 模型编辑
     */
    edit(params: {
        id: number;
        scene: string;
        channel: string;
        logo: string;
        name: string;
        intro: string;
        config: any;
        models: any[];
        is_disable: number;
    }): Promise<any> {
        return request.post({
            url: '/setting/ai/models/edit',
            params
        })
    },
    /**
     * 模型删除
     */
    delete(id: number): Promise<any> {
        return request.post({
            url: '/setting/ai/models/delete',
            params: { id }
        })
    },
    /**
     * 模型停用
     */
    disable(id: number): Promise<any> {
        return request.post({
            url: '/setting/ai/models/disable',
            params: { id }
        })
    }
}

export default aiModelsApi
